import { useAntdTable } from "ahooks";

export default function useTable(service, options) {
  const data = useAntdTable(service, options);
  //设置分页组件的默认交互
  if (data?.tableProps?.pagination) {
    data.tableProps.pagination.showSizeChanger = true;
    data.tableProps.pagination.showTotal = (total) => `共 ${total} 条`;
    data.tableProps.pagination.showQuickJumper = true;
    data.tableProps.pagination.pageSizeOptions = ["10", "20", "30", "40", "50", "60", "70", "80", "90"];
    data.tableProps.pagination.size = "small";
  }

  if(data?.tableProps)
    data.tableProps.showSorterTooltip={color:"white"}

  return data;
}
